package com.sakura.mybatisplus.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sakura.mybatisplus.entity.ProductVO;
import com.sakura.mybatisplus.entity.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT p.*, u.`name` user_name FROM `product` p, `user` u " +
            "WHERE p.uid = u.id AND u.id = 1")
    List<ProductVO> productList(Integer id);

}
